<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8"/>
  <link rel="shortcut icon" href="/favicon.ico"/>
  <link rel="stylesheet" href="<%= publicPath %>/browser_upgrade/index.css"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <!-- <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> -->
  <link rel="stylesheet" href="//at.alicdn.com/t/font_3302305_1pipj431qdk.css">
  <title><%= title %></title>
  <%- copyrightScript %>
</head>
<body>
<div id="app">
  <div class="super-xu-home">
    <div class="loading animate">
      <div class="square"></div>
      <div class="square"></div>
      <div class="square"></div>
      <div class="square"></div>
    </div>
    <div class="text"><%= title %>载入中…</div>
  </div>
  <div id="browser-upgrade">
    <div class="title">为了您的体验，推荐使用以下浏览器</div>
    <div class="browsers">
      <a href="https://www.microsoft.com/edge" target="_blank" class="browser">
        <img class="browser-icon" src="/browser_upgrade/edge.png"/>
        <div class="browser-name">Mircosoft Edge</div>
      </a>
      <a href="https://www.google.cn/chrome/" target="_blank" class="browser">
        <img class="browser-icon" src="/browser_upgrade/chrome.png"/>
        <div class="browser-name">Google Chrome</div>
      </a>
    </div>
  </div>
</div>
<script>
  function getBrowser() {
    var UserAgent = navigator.userAgent.toLowerCase();
    var browserInfo = {};
    var browserArray = {
      IE: window.ActiveXObject || "ActiveXObject" in window,
      // IE
      Chrome: UserAgent.indexOf('chrome') > -1 && UserAgent.indexOf('safari') > -1,
      // Chrome浏览器
      Firefox: UserAgent.indexOf('firefox') > -1,
      // 火狐浏览器
      Opera: UserAgent.indexOf('opera') > -1,
      // Opera浏览器
      Safari: UserAgent.indexOf('safari') > -1 && UserAgent.indexOf('chrome') == -1,
      // safari浏览器
      Edge: UserAgent.indexOf('edge') > -1,
      // Edge浏览器
      QQBrowser: /qqbrowser/.test(UserAgent),
      // qq浏览器
      WeixinBrowser: /MicroMessenger/i.test(UserAgent)
      // 微信浏览器
    };
    // console.log(browserArray)
    for (var i in browserArray) {
      if (browserArray[i]) {
        var versions = '';
        if (i == 'IE') {
          versions = UserAgent.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];
        } else if (i == 'Chrome') {
          for (var mt in navigator.mimeTypes) {

            //检测是否是360浏览器(测试只有pc端的360才起作用)
            if (navigator.mimeTypes[mt]['type'] == 'application/360softmgrplugin') {
              i = '360';
            }
          }
          versions = UserAgent.match(/chrome\/([\d.]+)/)[1];
        } else if (i == 'Firefox') {
          versions = UserAgent.match(/firefox\/([\d.]+)/)[1];
        } else if (i == 'Opera') {
          versions = UserAgent.match(/opera\/([\d.]+)/)[1];
        } else if (i == 'Safari') {
          versions = UserAgent.match(/version\/([\d.]+)/)[1];
        } else if (i == 'Edge') {
          versions = UserAgent.match(/edge\/([\d.]+)/)[1];
        } else if (i == 'QQBrowser') {
          versions = UserAgent.match(/qqbrowser\/([\d.]+)/)[1];
        }
        browserInfo.type = i; browserInfo.versions = parseInt(versions);
      }
    } return browserInfo;
  }
  const browserObj = getBrowser()
  if (!!window.ActiveXObject || 'ActiveXObject' in window) {
    document.getElementById('browser-upgrade').style.display = 'block'
  } else {
    var Loading = document.querySelector('.loading')
    Loading.classList.add('animate')
    Loading.addEventListener('animationend', function () {
      setTimeout(function () {
        Loading.classList.remove('animate')
      }, 600)
      setTimeout(function () {
        Loading.classList.add('animate')
      }, 1000)
    })
  }
</script>
<script type="module" src="/src/main.js"></script>
<% if (debugTool == 'eruda') { %>
<script src="//unpkg.com/eruda/eruda.js"></script>
<script>eruda.init()</script>
<% } %>
<% if (debugTool == 'vconsole') { %>
<script src="//unpkg.com/vconsole/dist/vconsole.min.js"></script>
<script>new VConsole()</script>
<% } %>
</body>
</html>
